home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / bbsutil / bsrc_250.zip / BINK.H < prev    next >
C/C++ Source or Header  |  1991-09-15  |  36KB  |  936 lines

  1. /*--------------------------------------------------------------------------*/
  2. /*                                                                          */
  3. /*                                                                          */
  4. /*      ------------         Bit-Bucket Software, Co.                       */
  5. /*      \ 10001101 /         Writers and Distributors of                    */
  6. /*       \ 011110 /          Freely Available<tm> Software.                 */
  7. /*        \ 1011 /                                                          */
  8. /*         ------                                                           */
  9. /*                                                                          */
  10. /*  (C) Copyright 1987-91, Bit Bucket Software Co., a Delaware Corporation. */
  11. /*                                                                          */
  12. /*                                                                          */
  13. /*                 Major definitions used in BinkleyTerm                    */
  14. /*                                                                          */
  15. /*                                                                          */
  16. /*    For complete  details  of the licensing restrictions, please refer    */
  17. /*    to the License  agreement,  which  is published in its entirety in    */
  18. /*    the MAKEFILE and BT.C, and also contained in the file LICENSE.250.    */
  19. /*                                                                          */
  20. /*    USE  OF THIS FILE IS SUBJECT TO THE  RESTRICTIONS CONTAINED IN THE    */
  21. /*    BINKLEYTERM  LICENSING  AGREEMENT.  IF YOU DO NOT FIND THE TEXT OF    */
  22. /*    THIS  AGREEMENT IN ANY OF THE  AFOREMENTIONED FILES,  OR IF YOU DO    */
  23. /*    NOT HAVE THESE FILES,  YOU  SHOULD  IMMEDIATELY CONTACT BIT BUCKET    */
  24. /*    SOFTWARE CO.  AT ONE OF THE  ADDRESSES  LISTED BELOW.  IN NO EVENT    */
  25. /*    SHOULD YOU  PROCEED TO USE THIS FILE  WITHOUT HAVING  ACCEPTED THE    */
  26. /*    TERMS  OF  THE  BINKLEYTERM  LICENSING  AGREEMENT,  OR  SUCH OTHER    */
  27. /*    AGREEMENT AS YOU ARE ABLE TO REACH WITH BIT BUCKET SOFTWARE, CO.      */
  28. /*                                                                          */
  29. /*                                                                          */
  30. /* You can contact Bit Bucket Software Co. at any one of the following      */
  31. /* addresses:                                                               */
  32. /*                                                                          */
  33. /* Bit Bucket Software Co.        FidoNet  1:104/501, 1:343/491             */
  34. /* P.O. Box 460398                AlterNet 7:491/0                          */
  35. /* Aurora, CO 80046               BBS-Net  86:2030/1                        */
  36. /*                                Internet f491.n343.z1.fidonet.org         */
  37. /*                                                                          */
  38. /* Please feel free to contact us at any time to share your comments about  */
  39. /* our software and/or licensing policies.                                  */
  40. /*                                                                          */
  41. /*--------------------------------------------------------------------------*/
  42.  
  43. /*--------------------------------------------------------------------------*/
  44. /* LEGIBLE SECTION.  Definitions to make "C" look like a real language.     */
  45. /*--------------------------------------------------------------------------*/
  46.  
  47. #ifndef BINK_DEFINED
  48. #define BINK_DEFINED
  49.  
  50. #ifndef max
  51. #define max(a,b)     ((a)>(b)?(a):(b))
  52. #endif
  53.  
  54. #ifndef min
  55. #define min(a,b)     ((a)<=(b)?(a):(b))
  56. #endif
  57.  
  58. /*
  59.  * updcrc macro derived from article Copyright (C) 1986 Stephen Satchell. 
  60.  *  NOTE: First argument must be in range 0 to 255.
  61.  *        Second argument is referenced twice.
  62.  * 
  63.  * Programmers may incorporate any or all code into their programs, 
  64.  * giving proper credit within the source. Publication of the 
  65.  * source routines is permitted so long as proper credit is given 
  66.  * to Stephen Satchell, Satchell Evaluations and Chuck Forsberg, 
  67.  * Omen Technology.
  68.  */
  69.  
  70. #define updcrc(cp, crc) ( crctab[((crc >> 8) & 255) ^ cp] ^ (crc << 8))
  71.  
  72. /* We need it the other way around for BinkleyTerm */
  73. #define xcrc(crc,cp) ( crctab[((crc >> 8) & 255) ^ cp] ^ (crc << 8))
  74.  
  75. typedef unsigned bit;
  76. typedef unsigned int word;
  77. typedef unsigned char byte;
  78.  
  79. #define fallthrough
  80.  
  81. #define LOCAL        static
  82. #define empty_str    ""
  83.  
  84. /* The following changes by Greylock Software, to facilitate the MEWEL
  85.  * version of Bink.
  86.  */
  87.  
  88. #define PRDCT_NM(m)     PrdctTbl[m]
  89. #define WELCOME_LEN     1024
  90.  
  91. #define POLL_POPUP
  92. #define EventSub()
  93.  
  94. #ifdef MILQ
  95. #include "Milq.H"
  96. #endif
  97.  
  98.  
  99. /*
  100.  * This is an attempt to clean up some of the mess.  No longer will
  101.  * we ifdef MILQ simple SendMessages. This should make the code
  102.  * considerably more readable.  In the context of simple Bink,
  103.  * SendMessage has no meaning.
  104.  */
  105.  
  106. #ifndef MILQ
  107. #define GetDlgItem(a,b)      a
  108. #define FlLnModeSet(a,b)
  109. #define SendMessage(a,b,c,d)
  110. #define WinClear(w)
  111. #define WinDrawAllWindows()
  112. #define WinSetText(a,b)
  113. #define call_hWnd       callwin
  114. #define file_hWnd       filewin
  115. #define history_hWnd    historywin
  116. #define history_BBS     historywin
  117. #define history_Cost    historywin
  118. #define history_Fl      historywin
  119. #define history_Last    historywin
  120. #define history_Out     historywin
  121. #define hold_hWnd       holdwin
  122. #define hold_Poll       holdwin
  123. #define hold_Addr       holdwin
  124. #define hold_Init       holdwin
  125. #define hold_Hdr        holdwin
  126. #define HoldWndDtl(x)   holdwin
  127. #define settings_hWnd   settingswin
  128. #define settings_DtTm   settingswin
  129. #define settings_Evt    settingswin
  130. #define settings_Port   settingswin
  131. #define settings_MTask  settingswin
  132. #define settings_Status settingswin
  133. #endif
  134.  
  135. /* These should be stomped out of existance.  They are bad memories
  136.  * from a failed experiment.  However, these should NOT be eliminated
  137.  * yet.  NULL in the MEWEL environment IS NOT the same as NULL in the
  138.  * BC environment.  Comparisons to NULLGLOBALPTR should NOT simply be
  139.  * changed to NULL, but rather (char far *)0.
  140.  */
  141.  
  142. #define NULLGLOBALPTR   (char far *)0
  143. #define NULLLOCALPTR    (char *)0
  144.  
  145. struct _lang_hdr
  146. {
  147.    int ElemCnt;
  148.    int PoolSize;
  149. };
  150.  
  151. struct _key_fnc
  152. {
  153.    int FncIdx;
  154.    int ScanCode;
  155.  };
  156.  
  157. struct _key_fnc_hdr
  158. {
  159.    int              KeyFncCnt;
  160.    int             *KeyFncAry;
  161.    struct _key_fnc *KeyFncTbl;
  162.  };
  163.  
  164.  
  165. #define FA_RDONLY   0x01    /* File is readonly */
  166. #define FA_HIDDEN   0x02    /* File is hidden   */
  167. #define FA_SYSTEM   0x04    /* System file      */
  168. #define FA_VOLID    0x08    /* Volume ID        */
  169. #define FA_SUBDIR   0x10    /* Subdirectory     */
  170. #define FA_ARCH     0x20    /* Archive file     */
  171.  
  172. struct FILEINFO
  173. {
  174.    char rsvd[21];
  175.    char attr;
  176.    long time;
  177.    long size;
  178.    char name[13];
  179.    char nill;
  180. };
  181.  
  182.  
  183. #define DENY_ALL   0
  184. #define DENY_NONE  1
  185. #define DENY_READ  2
  186. #define DENY_RDWR  3
  187. #define DENY_WRITE 4
  188.  
  189.  
  190. typedef struct pnums
  191. {
  192.    char num[20];
  193.    char pre[20];
  194.    char suf[20];
  195.    int len;
  196.    struct pnums *next;
  197. } PN_TRNS;
  198.  
  199. typedef struct mnums
  200. {
  201.    byte mdm;
  202.    char pre[50];
  203.    char suf[50];
  204.    struct mnums *next;
  205. } MDM_TRNS;
  206.  
  207.  
  208. struct prototable
  209. {
  210.    char first_char;
  211.    int entry;
  212. };
  213.  
  214. typedef struct j_types
  215. {
  216.    char j_match[30];
  217.    struct j_types *next;
  218. } J_TYPES, *J_TYPESP;
  219.  
  220. /* mailtypes bit field definitions */
  221. #define MAIL_CRASH   0x0001
  222. #define MAIL_HOLD    0x0002
  223. #define MAIL_DIRECT  0x0004
  224. #define MAIL_NORMAL  0x0008
  225. #define MAIL_REQUEST 0x0010
  226. #define MAIL_WILLGO  0x0020
  227. #define MAIL_TRIED   0x0040
  228. #define MAIL_TOOBAD  0x0080
  229. #define MAIL_UNKNOWN 0x0100
  230. #define MAIL_RES0200 0x0200
  231. #define MAIL_QSMALL  0x0400
  232. #define MAIL_RES0800 0x0800
  233. #define MAIL_RES1000 0x1000
  234. #define MAIL_RES2000 0x2000
  235. #define MAIL_RES4000 0x4000
  236. #define MAIL_RES8000 0x8000
  237.  
  238. typedef struct finfo
  239. {
  240.    int info_size;
  241.    char curr_fossil;
  242.    char curr_rev;
  243.    char far *id_string;
  244.    int ibufr;
  245.    in